﻿#region codejockey.net Copyright Banner
/***************************************************************\
 * Copyright 2010 codejockey.net.                                *
 *                                                               *
 * This code is property of codejockey.net and cannot be used    *
 * without explicit permission given by a codejockey.net         *
 * Representative.  For details contact: source@codejockey.net   *
 \***************************************************************/
#endregion

using System;
using System.Configuration;

namespace codejockey.BingPaper.Configuration
{
  public class BingPaperConfigSection: ConfigurationSection
  {
  	public const string SectionName = "bingPaper";

  	/// <summary>
    /// Retrieves the instance of the configuration section.
    /// </summary>
    /// <returns>An instance of the BingConfigSection configuration section.</returns>
    public static BingPaperConfigSection GetInstance()
    {
      var section = ConfigurationManager.GetSection(SectionName) as BingPaperConfigSection;

      if (section == null)
        throw new Exception(string.Format("Missing config section: {0}", SectionName));

      return section;
    }

    /// <summary>
    /// Settings contains the BingPaper configuration settings.
    /// </summary>
    [ConfigurationProperty("settings")]
    public BingPaperConfigElement Settings
    {
      get { return (BingPaperConfigElement)base["settings"]; }
      set { base["settings"] = value; }
    }
  }
}
